<template>
  <view>
    <!-- 系统(任务)通知组件 -->
    <view class="questnotice" name="questnotice" v-if="isShow">
      <view class="main">
        <view class="info">
          <view class="header">
            您有新的运输任务
          </view>
          <view class="infoC">
            <text>运输车辆：京A 123456 运输路线：成都分拣中心——金牛区营业部</text>
          </view>
          <view class="infoFooter">
            <view class="time">
              2022.05.04 13:00
            </view>
            <!-- 查看详情,点击跳转到系统通知详情页,在此用navigator包裹 -->
            <navigator url="/subpkg/taskNotification_details/taskNotification_details">
              <u-button type="warning" :plain="true" text="查看详情" size="mini" shape="circle"></u-button>
            </navigator>
          </view>
        </view>
      </view>
    </view>
    <!-- 无任何消息 -->
    <view class="noMessage" v-else>
      <image src="../../static/tab_icons/不存在.png" mode=""></image>
      <view class="text">暂无消息</view>
    </view>
  </view>
</template>

<script>
  export default {
    name: 'questNotice',
    components: {},
    data() {
      return {
     isShow:false
      };
    },
    async created() {
      let res = await uni.$http.get('/messages/page', {
        contentType: "200",
        page: '1',
        pageSize: '3'
      })
      console.log(res)
    },
    mounted() {},
    onLoad() {

    },
    methods: {

    }
  }
</script>

<style lang="scss">
  .main {
    padding: 15px 13px 14px;
    background-color: #F4F4F4;

    .info {
      box-sizing: border-box;
      padding: 16px 16px 25px 16px;
      height: 151px;
      background-color: #fff;
      border-radius: 10px;

      .header {
        padding-bottom: 13px;
        border-bottom: 1px solid #ccc;
        font-size: 14px;
      }

      .infoC {
        display: flex;
        justify-content: space-between;
        padding-top: 11px;
        padding-bottom: 19px;
        font-size: 13px;
        color: #818181;
      }

      .infoFooter {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .time {
          width: 240px;
          font-size: 12px;
          color: #818181;
        }

        .u-button {
          width: 76px;
          height: 24px;
          color: #EF4F3F;

        }
      }
    }
    // 暂无消息
    .noMessage {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%,-50%);
      image{
      width: 200px;
      height: 120px;
      }
      .text {
        color: #818181;
        font-size: 14px;
      }
    }
  }
</style>